<?php
/**
 * wifi模块定义
 *
 * @author boyhood
 * @url http://bbs.we7.cc/
 */
defined('IN_IA') or exit('Access Denied');
class junsion_wifinavModule extends WeModule {

	public function settingsDisplay($settings) {
		global $_W, $_GPC;
		if(checksubmit()) {
			//字段验证, 并获得正确的数据$dat
			$dat['enter'] = $_GPC['enter'];
			$dat['share'] = $_GPC['share'];
			$dat['clipboard'] = $_GPC['clipboard'];
			$dat['version'] = $_GPC['version'];
			$dat['copyright'] = $_GPC['copyright'];
			$dat['aboutus'] = $_GPC['aboutus'];
			$dat['title'] = $_GPC['title'];
			$dat['autoaudit'] = $_GPC['autoaudit'];
			$dat['advPic'] = $_GPC['advPic'];
			$dat['adv_appid'] = $_GPC['adv_appid'];
			$dat['adv_path'] = $_GPC['adv_path'];
			$dat['adv'] = $_GPC['adv'];
			$dat['qiniu'] = $_GPC['qiniu'];
			$dat['wx_color'] = $_GPC['wx_color'];
			$dat['word'] = $_GPC['word'];
			$dat['linkNotice'] = $_GPC['linkNotice'];
			$dat['linkMsg'] = $_GPC['linkMsg'];
			$dat['saudio'] = $_GPC['saudio'];
			$dat['faudio'] = $_GPC['faudio'];
			$dat['distributor'] = $_GPC['distributor'];
			
			if ($this->saveSettings($dat)){
				message('保存成功',referer(),'sueccuss');
			}else{
				message('保存失败',referer(),'error');
			}
		}
		$settings['enter']['enter_1'] = $settings?$settings['enter']['enter_1']:'../addons/junsion_wifinav/resource/enter1.png';
		$settings['enter']['enter_2'] = $settings?$settings['enter']['enter_2']:'../addons/junsion_wifinav/resource/enter2.jpg';
		$settings['enter']['enter_3'] = $settings?$settings['enter']['enter_3']:'../addons/junsion_wifinav/resource/enter3.jpg';
		//这里来展示设置项表单
		if (!$settings['version']) $settings['version'] = '1.0';
		include $this->template('setting');
	}

}
